package org.chispa.api.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class PropertyLoader {
	
	private PropertyLoader(){};
	
	private static final String CONFIG_FILE="config.properties";
	
	private static Properties prop;
	
	static{
		InputStream in=PropertyLoader.class.getResourceAsStream("/"+CONFIG_FILE);
		prop=new Properties();
		try {
			prop.load(in);
        } catch (IOException e) {
            e.printStackTrace();
        }

	}
	
	public static String getProperty(Class<?>clazz, String name)
	{
		return prop.getProperty((clazz.getName()+"."+name).toLowerCase());
	}

}
